#ifndef __GAME_SCENE_H__
#define __GAME_SCENE_H__
#include <string>
#include <iostream>
#include "cocos2d.h"
#include "Box2D/Box2D.h"
#include "ccTypes.h"
#include "Box/ContactListener.h"
#include "Box/PRFilledPolygon.h"
#include "Box/B2DebugDrawLayer.h"
#include "cocos-ext.h"

#include "GameObject.h"

class GameScene : public cocos2d::CCLayer
{
private:
	cocos2d::extension::CCArmature *armature;
	cocos2d::extension::CCArmature *armature2;

	float _speed;
	float _speed2;
	float _speed3;

    float _dist;
    float _dist2;
    float _dist3;

    CCLabelTTF* _p1;
    CCLabelTTF* _p2;
    CCLabelTTF* _p3;
       CCLabelBMFont* _sp;

    int _s1;
    int _s2;


    GameUser *_user;
    GameUser *_op;
    GameUser *_op2;

    b2World* _world;
      b2Body *_groundBody;
      b2Fixture *_bottomFixture;
      b2Fixture *_ballFixture;
      b2Body *_paddleBody;
      b2Fixture *_paddleFixture;
      b2MouseJoint *_mouseJoint;
      ContactListener *_contactListener;

public:
    // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
    virtual bool init();  

    // there's no 'id' in cpp, so we recommend returning the class instance pointer
    static cocos2d::CCScene* scene();
    
    void ccTouchesEnded(CCSet* touches, CCEvent* event);

    // a selector callback
    void menuCloseCallback(CCObject* pSender);
    
    void tick(float dt);
    void tick2(float dt);


    void runCharacter(CCObject* pSender);
    void falldownCharacter(CCObject* pSender);
    void falldownpreCharacter(CCObject* pSender);
      // implement the "static node()" method manually
    CREATE_FUNC(GameScene);
};

#endif
